FROM python:3.8-bullseye as builder

ADD . /opt/code

WORKDIR /opt/code

RUN pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip3 install huawei_simulation_interface-0.12.1-py3-none-any.whl
RUN pyinstaller -F src/delayed_eva/delayed_eva.py && pyinstaller -F src/realtime_eva/realtime_eva.py


FROM python:3.8-bullseye

RUN useradd -m octopus -u 1099 -c 'Octopus User' -s /bin/bash  && rm -rf /var/apt/cache/*
USER octopus
WORKDIR /home/octopus/
COPY --from=builder /opt/code/dist/*_eva /usr/local/bin

ENV LANG C.UTF-8

CMD ["/bin/bash"]

